﻿<li>
    <span class="sp-title">选择日期：</span>
    <div class="input-group">
        <input type="text" class="input time-input" name="TimePoint" id="TimePoint" value="@string.Format("{0:yyyy-MM-dd}", ViewData["TimePoint"])" placeholder="日期" onclick="WdatePicker({el:'TimePoint',onpicked:function(){@ViewData["JsFun"];}, isShowClear: false, readOnly: true})" />
    </div>
    <div class="btn-group margin10-l">
        <button class="btn" id="btnPreDay" type="button">前一天</button>
        <button class="btn" id="btnNextDay" type="button">后一天</button>
    </div>
</li>

<script>
    $(document).ready(function () {
        //前一天按钮点击事件
        $("#btnPreDay").click(function () {
            var d = new Date($("#TimePoint").val());
            d.setTime(d.getTime() - 24 * 60 * 60 * 1000);
            var preDate = d.format("yyyy-MM-dd");
            $("#TimePoint").val(preDate);
            @ViewData["JsFun"];
        });

        //后一天按钮点击事件
        $("#btnNextDay").click(function () {
            var d = new Date($("#TimePoint").val());
            d.setTime(d.getTime() + 24 * 60 * 60 * 1000);
            var nextDate = d.format("yyyy-MM-dd");
            $("#TimePoint").val(nextDate);
            @ViewData["JsFun"];
        });
    });
</script>